package org.springframework.boot.tests.hibernate52.mytest.autoconfig;

import org.springframework.boot.autoconfigure.AutoConfigurationImportSelector;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.tests.hibernate52.mytest.bean.TestBeanA;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ConfigurationClassPostProcessor;

import javax.annotation.PostConstruct;

/**
 * {@link ConfigurationClassPostProcessor#postProcessBeanDefinitionRegistry} 中会解析自动装备的类，
 * 主要实现在 main函数中 @import 注解导入的 {@link AutoConfigurationImportSelector}
 */
@Configuration
@ConditionalOnClass(TestBeanA.class)
public class MyAutoConfiguration {

	@PostConstruct
	public void init() {
		System.out.println(
				"自定义AutoConfiguration->>> " + MyAutoConfiguration.class.getName());
	}

}
